home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / RCS / locale.h,v < prev    next >
Encoding:
Text File  |  1991-12-16  |  4.7 KB  |  186 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.2
  10. date     91.12.16.14.04.28;  author rab;  state Exp;
  11. branches ;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     91.10.29.16.37.13;  author rab;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @@
  22.  
  23.  
  24. 1.2
  25. log
  26. @Added definition of _LC_LAST
  27. @
  28. text
  29. @/*
  30.  * locale.h --
  31.  *
  32.  *    Declarations of things specific to this locale (USA).
  33.  *
  34.  * Copyright 1991 Regents of the University of California
  35.  * Permission to use, copy, modify, and distribute this
  36.  * software and its documentation for any purpose and without
  37.  * fee is hereby granted, provided that this copyright
  38.  * notice appears in all copies.  The University of California
  39.  * makes no representations about the suitability of this
  40.  * software for any purpose.  It is provided "as is" without
  41.  * express or implied warranty.
  42.  *
  43.  * $Header: /sprite/src/lib/include/RCS/locale.h,v 1.1 91/10/29 16:37:13 rab Exp Locker: rab $
  44.  */
  45.  
  46. #ifndef _LOCALE_H
  47. #define _LOCALE_H
  48.  
  49. #ifndef NULL
  50. #define NULL            0
  51. #endif
  52.  
  53. #define LC_ALL          0
  54. #define LC_CTYPE        1
  55. #define LC_NUMERIC      2
  56. #define LC_TIME         3
  57. #define LC_MONETARY     4
  58. #ifndef _POSIX_SOURCE
  59. #define LANGINFO        5
  60. #endif      
  61. #define LC_COLLATE      6
  62. #define LC_MESSAGES     7
  63. #define _LC_LAST        7
  64.  
  65. #ifndef _POSIX_SOURCE
  66. #define MAXLOCALE       8
  67.  
  68. #define ON      1
  69. #define OFF     0
  70.  
  71. /* Maximum number of characters in the locale name */
  72.  
  73. #define MAXLOCALENAME   14
  74.  
  75. /* Maximum number of substitute mappings in LC_COLLATE table */
  76.  
  77. #define MAXSUBS         64
  78.  
  79. /* Maximum width of domain name */
  80.  
  81. #define MAXDOMAIN       255
  82.  
  83. /* Maximum width of format string for message domains */
  84.  
  85. #define MAXFMTS         32
  86.  
  87. /* Maximum width of the message string */
  88.  
  89. #define MAXMSGSTR       255
  90.  
  91. /* The directory where category components are kept */
  92.  
  93. #define LOCALE_DIR      "/usr/share/lib/locale/"
  94.  
  95. /* The directory that is private to an individual workstation user */
  96.  
  97. #define PRIVATE_LOCALE_DIR      "/etc/locale/"
  98.  
  99. /* The name of the file that contains default locale */
  100.  
  101. #define DEFAULT_LOC             ".default"
  102.  
  103. /* size of "ctype" */
  104.  
  105. #define CTYPE_SIZE      514
  106. #endif  /* _POSIX_SOURCE */
  107.  
  108. extern char *setlocale(/* int category, const char *locale */);
  109. extern struct lconv *localeconv(/* void */);
  110. #ifndef _POSIX_SOURCE
  111. extern struct dtconv *localdtconv();
  112. #endif
  113.  
  114. /*
  115.  * Numeric and monetary conversion information.
  116.  */
  117. struct lconv {
  118.         char    *decimal_point; /* decimal point character */
  119.         char    *thousands_sep; /* thousands separator character */
  120.         char    *grouping;      /* grouping of digits */
  121.         char    *int_curr_symbol;       /* international currency symbol */
  122.         char    *currency_symbol;       /* local currency symbol */
  123.         char    *mon_decimal_point;     /* monetary decimal point character */
  124.         char    *mon_thousands_sep;     /* monetary thousands separator */
  125.         char    *mon_grouping;  /* monetary grouping of digits */
  126.         char    *positive_sign; /* monetary credit symbol */
  127.         char    *negative_sign; /* monetary debit symbol */
  128.         char    int_frac_digits; /* intl monetary number of fractional digits */        char    frac_digits;    /* monetary number of fractional digits */
  129.         char    p_cs_precedes;  /* true if currency symbol precedes credit */
  130.         char    p_sep_by_space; /* true if space separates c.s.  from credit */
  131.         char    n_cs_precedes;  /* true if currency symbol precedes debit */
  132.         char    n_sep_by_space; /* true if space separates c.s.  from debit */
  133.         char    p_sign_posn;    /* position of sign for credit */
  134.         char    n_sign_posn;    /* position of sign for debit */
  135. };
  136.  
  137. #ifndef _POSIX_SOURCE
  138. /*
  139.  * Date and time conversion information.
  140.  */
  141. struct dtconv {
  142.         char    *abbrev_month_names[12];        /* abbreviated month names */
  143.         char    *month_names[12];       /* full month names */
  144.         char    *abbrev_weekday_names[7];       /* abbreviated weekday names */
  145.         char    *weekday_names[7];      /* full weekday names */
  146.         char    *time_format;   /* time format */
  147.         char    *sdate_format;  /* short date format */
  148.         char    *dtime_format;  /* date/time format */
  149.         char    *am_string;     /* AM string */
  150.         char    *pm_string;     /* PM string */
  151.         char    *ldate_format;  /* long date format */
  152. };
  153.  
  154. /*
  155.  * Langinfo
  156.  */
  157. struct langinfo {
  158.         char *yesstr;   /* yes string */
  159.         char *nostr;    /* nostr */
  160. };
  161.  
  162. /*
  163.  * NLS nl_init
  164.  */
  165. #define valid(ptr) (ptr != (char *) NULL)
  166. #define nl_init(lang) ((valid(lang) && *lang) ? \
  167.     (valid(setlocale (LC_ALL, lang) ) ? 0 : -1) \
  168.     : -1)
  169. #endif  /* _POSIX_SOURCE */
  170.  
  171. #endif / *!_LOCALE_H */
  172.  
  173. @
  174.  
  175.  
  176. 1.1
  177. log
  178. @Initial revision
  179. @
  180. text
  181. @d15 1
  182. a15 1
  183.  * $Header$
  184. d35 1
  185. @
  186.